package com.zr.sms.serviceimpl;

import com.zr.sms.dao.GoodsListDao;
import com.zr.sms.daoimpl.GoodsListDaoImpl;
import com.zr.sms.service.GoodsListService;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class GoodsListServiceImpl implements GoodsListService{
	GoodsListDao gl = new GoodsListDaoImpl();
	@Override
	public JSONObject getGoodsLists(int start, int pageSize) {
		JSONObject goodslists = new JSONObject();
		goodslists.put("total", gl.getGlsConut());
		goodslists.put("rows", JSONArray.fromObject(gl.getGoodsLists(start, pageSize)));
		return goodslists;
	}

	@Override
	public JSONObject getGoodsLists(int start, int pageSize, String searchdate) {
		JSONObject goodslists = new JSONObject();
		goodslists.put("total", gl.getGlsConut());
		goodslists.put("rows", JSONArray.fromObject(gl.getGoodslists(start, pageSize,searchdate)));
		return goodslists;
	}

}
